package edu.kpi.pzks2.simulator.links;

import edu.kpi.pzks2.simulator.processing.Processor;

public class Message {
    private final int weight;
    private final int resultOfTask;
    private final int targetTask;
    private final Processor procTo;
    private final Processor procFrom;
    
    public Message(
            final int weight,
            final int resultOfTask,
            final int targetTask,
            final Processor procTo,
            final Processor procFrom) {
        this.weight = weight;
        this.resultOfTask = resultOfTask;
        this.procTo = procTo;
        this.procFrom = procFrom;
        this.targetTask = targetTask;
    }
    
    public int getWeight() {
        return weight;
    }
    
    public int getResultOfTask() {
        return resultOfTask;
    }

    public int getTargetTask() {
        return targetTask;
    }
    
    public Processor getProcTo() {
        return procTo;
    }
    
    @Override
    public String toString() {
        return String.format("%d>%d: %d>%d", procFrom.getProcId(), procTo.getProcId(), resultOfTask, targetTask);
    }
}
